package com.example.doubledb.web;

import com.example.doubledb.entity.SysMenu;
import com.example.doubledb.service.SysMenuService;
import lombok.RequiredArgsConstructor;
import org.springframework.web.bind.annotation.*;

import java.util.List;

@RestController
@RequestMapping("menu")
@RequiredArgsConstructor
public class SysMenuController {

    private final SysMenuService menuService;

    @GetMapping()
    public List<SysMenu> query(SysMenu sysMenu) {

        List<SysMenu> result = menuService.selectList(sysMenu);
        return result;
    }

    @PostMapping()
    public String add(@RequestBody SysMenu menu) {

        return "add success!";
    }


    @PutMapping()
    public String edit() {

        return "admin edit success!";
    }

    @DeleteMapping()
    public String remove() {
        return "delete success!";
    }


}
